package P091_enumWithAnnotation;

import P091_enumWithAnnotation.access.Access;
import P091_enumWithAnnotation.access.Identifier;

/**
 * Desc:&emsp;&ensp;
 *
 * @author 李渊&emsp;liyuan7@yusys.com.cn
 * @version 1.0
 * 
 */
public class demo {
    public static void main(String[] args) {
        Foo b = new Foo();
        Access access = b.getClass().getAnnotation(Access.class);
        if (access == null) {
            // 没有Access注解
            System.out.println(Identifier.REFUSE_WORD);
        } else if (!access.level().identify()) {
            // 鉴权失败
            System.out.println(access.level().REFUSE_WORD);
        }
    }
}
